Skip to content

Impl plumbing for the STM32 #20

Closed
WilliamTakeshi wants to merge 4 commits intolake-rs:mainfrom
WilliamTakeshi:plumbing-stm32
Closed

Impl plumbing for the STM32 #20
WilliamTakeshi wants to merge 4 commits intolake-rs:mainfrom
WilliamTakeshi:plumbing-stm32

Conversation

@WilliamTakeshi
Copy link
Copy Markdown
Collaborator

This PR impl the embedded_cal::plumbing::hash::Sha2Short trait (only the SHA2-256) for the STM32 (tested on WBA55CG).

@WilliamTakeshi WilliamTakeshi self-assigned this Feb 10, 2026
This was referenced Mar 2, 2026
@chrysn
Copy link
Copy Markdown
Member

chrysn commented Mar 2, 2026

There are a few things I think might make sense, but can leave that for after merging:

  • Refactor {HASH reinit and configure-and-reset-context and restrore-context-from-self-if-any} into a single function (used both in finalize and update)
  • Check whether we always have to reinit the HASH if we always leave it in a good state
  • Consider whether we want to have a debug_assert-only step where we read if the lengths always line up with NBEW (we know it works well for stm32wba55, but sooner or later we'll have chips on the almost-same peripheral, and then that'll be a good debug helper)
  • Provide an implementation of update-and-finalize to save the reinit and load-and-restore (but we'd have to add that to the trait in the first place, and due to UPDATE_MULTICHUNK=true, we only save O(1) and not O(n) blocks)

If you agree that none of those has to happen now, I'd merge #23 and open a tracking issue with the above for potential later enhancements.

@WilliamTakeshi
Copy link
Copy Markdown
Collaborator Author

Sure! I would prefer to merge #23 the way it is right now and add this as future issues, (can be assigned to me)

I agree with all points, just didn't fully get "Check whether we always have to reinit the HASH if we always leave it in a good state". You mean checking the registers before writing on them?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants